<?php

include 'includes.php';


if (isset($_SESSION['user']) && $_SESSION['user']['permisos'] == 'admin') {
    $item = R::dispense('items');

    $item->linkh = $_POST['linkH'];
    $item->linkhw = $_POST['linkHW'];
    $item->slot = $_POST['slot'];
    $item->tipo = $_POST['tipo'];

    $boss = R::load('bosses', $_POST['idboss']);

    $boss->ownItemList[] = $item;

    R::store($boss);
}


error_reporting(E_ALL);
$host3 = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = "verboss.php?id=".$_POST['idboss'];
header("Location: http://" . $host3 . $uri . "/" . $extra);
die();
?>
